<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
  <script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
  <script src="../js/babel.js"></script>
</head>

<body>
  <div id="root"></div>

  <script type="text/babel">
    function Welcom(props) {
      if (props) {
        return <div>Hello, {props.name}</div>
      } else {
        return <div>Hello, World</div>
      }
    }

    function tick() {
      const element = (
        <div>
          <h1>Hello, World</h1>
          <h1>现在时间是：{new Date().toLocaleString()}</h1>

        </div>)
      ReactDOM.render(element, document.getElementById('root'))

    }

    // ReactDOM.render(<Welcom name='mal' />, document.getElementById('root'))
    setInterval(tick, 1000)
  </script>
</body>

</html>